home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12129 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: polarnet.com!floyd
  2. From: floyd@polarnet.com (Floyd Davidson)
  3. Newsgroups: comp.os.linux.misc,comp.lang.c++,gnu.gcc.help
  4. Subject: Re: Help: how do you redirect compile error to a file
  5. Date: 18 Mar 1996 15:27:58 GMT
  6. Organization: __________
  7. Message-ID: <4ijvdu$8g8@news2.cais.com>
  8. References: <4igdeo$8tf@news.jhu.edu> <fcusack-1803960612430001@mudskipper.cac.psu.edu>
  9. Reply-To: floyd@tanana.polarnet.com
  10. NNTP-Posting-Host: tanana.polarnet.com
  11.  
  12. fcusack@tdx.org wrote:
  13. >In article <4igdeo$8tf@news.jhu.edu>, yuehong@psi.ece.jhu.edu (yuehong) wrote:
  14. >
  15. >> I try to use the following command when I compile hello.cpp 
  16. >> using gcc on linux:
  17. >> 
  18. >> g++ hello.cpp >bug
  19. >> 
  20. >
  21. >Errors go to stderr, the '>' operator only redirects stdout. If you are
  22. >using sh/ksh/bash/... then you need 
  23. >   
  24. >   g++ hello.cpp >bug 2>&1
  25.  
  26. And if you do this:
  27.  
  28.      g++ hello.cpp 2>&1 | tee bug
  29.  
  30. It will also display on the screen (as well as be sent to a file).
  31. This works fine with make too:
  32.  
  33.      make 2>&1 | tee make.out
  34.  
  35. is the way I run make all the time.
  36.  
  37.   Floyd
  38. -- 
  39. Floyd L. Davidson          Salcha, Alaska         floyd@tanana.polarnet.com
  40.